package cn.fay.chapter14;

public class Position {
	private String title;
	private NPerson nPerson;
	public Position(String jobTitle,NPerson employee) {
		title=jobTitle;
		nPerson=employee;
		if (nPerson==null) {
			nPerson=NPerson.NULL;
		}
	}
	public Position(String jobTitle){
		title=jobTitle;
		nPerson=NPerson.NULL;
	}
	
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public NPerson getnPerson() {
		return nPerson;
	}
	public void setnPerson(NPerson nPerson) {
		this.nPerson = nPerson;
		if (this.nPerson==null) {
			this.nPerson=NPerson.NULL;
		}
	}
	@Override
	public String toString() {
		return "Position: "+title+" "+nPerson;
	}
}
